// 组织架构

import request from '@/utils/request'

// 获取组织架构的数据
export function zuZhiJiaGouAPI() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

// 获取员工简单列表 --- 弹窗负责人
export function getXiaLaAPI() {
  return request({
    url: '/sys/user/simple',
    method: 'GET'
  })
}

// 添加部门接口
export function addBuMenAPI(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

// 获取部门详情接口
export function getBuMenAPI(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}

// 根据id 修改部门详情 ------ 编辑
export function setBuMenAPI({ id, data }) {
  return request({
    url: `/company/department/${id}`,
    method: 'PUT',
    data
  })
}

// 删除部门 -------------
export function delBuMenAPI(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
